<html>
<head><meta charset="utf-8"><title>dependent dataflow analyses · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html">dependent dataflow analyses</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="168172513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168172513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168172513">(Jun 14 2019 at 21:19)</a>:</h4>
<p>Within a dataflow analysis, what's the cleanest way to depend on the results of another dataflow pass?</p>
<p>Right now I'm calling <code>state_for_location</code> at each step, which makes it O(N^2) in the number of statements in a block</p>



<a name="168172646"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168172646" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168172646">(Jun 14 2019 at 21:20)</a>:</h4>
<p>I also need to be able to get the results of both analyses out (right now I'm computing the first and then borrowing it while I compute the second)</p>



<a name="168172830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168172830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168172830">(Jun 14 2019 at 21:24)</a>:</h4>
<p>I could start calling the statement_effect callbacks myself, but that seems like it could be brittle..</p>



<a name="168172870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168172870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168172870">(Jun 14 2019 at 21:25)</a>:</h4>
<p>cc <span class="user-mention" data-user-id="116083">@pnkfelix</span></p>



<a name="168172995"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168172995" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168172995">(Jun 14 2019 at 21:27)</a>:</h4>
<p>Ideally I'd also get the actual effects at each statement, not just the resulting state</p>



<a name="168174525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168174525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168174525">(Jun 14 2019 at 21:51)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/compare/master...tmandry:moar-generator-optimization-1?expand=1#diff-0ec62af168b51795a97fe1a6a8a5eedf" target="_blank" title="https://github.com/rust-lang/rust/compare/master...tmandry:moar-generator-optimization-1?expand=1#diff-0ec62af168b51795a97fe1a6a8a5eedf">here's the code</a> for what I'm doing now</p>



<a name="168174701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168174701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168174701">(Jun 14 2019 at 21:54)</a>:</h4>
<p>Right now, the most efficient way seems to be to keep track of my own BlockSets and update them during every callback in <code>BitDenotation</code> ("unroll" the implementation of <code>state_for_location</code> into my type, essentially)</p>



<a name="168174757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168174757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168174757">(Jun 14 2019 at 21:55)</a>:</h4>
<p>I'm not sure how comfortable people will be with this though</p>



<a name="168174824"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168174824" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168174824">(Jun 14 2019 at 21:56)</a>:</h4>
<p>cc <span class="user-mention" data-user-id="116009">@nikomatsakis</span> since you're also listed as a dataflow expert :)</p>



<a name="168174844"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168174844" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168174844">(Jun 14 2019 at 21:56)</a>:</h4>
<p>Hmm</p>



<a name="168174857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168174857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168174857">(Jun 14 2019 at 21:57)</a>:</h4>
<p>This reminds me that I wanted to sync up with you on the work you've been doing just to get an overview and try to get up to speed</p>



<a name="168174858"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168174858" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168174858">(Jun 14 2019 at 21:57)</a>:</h4>
<p>Think you'd be game to schedule some time to do that?</p>



<a name="168174859"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168174859" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168174859">(Jun 14 2019 at 21:57)</a>:</h4>
<p>Yeah, sure!</p>



<a name="168174862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168174862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168174862">(Jun 14 2019 at 21:57)</a>:</h4>
<p>Also that we should really start converting this code to datafrog :P</p>



<a name="168174952"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168174952" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168174952">(Jun 14 2019 at 21:58)</a>:</h4>
<p>(re: scheduling, I'm free Mon/Tue afternoon PST, or Wed morning)</p>



<a name="168174978"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168174978" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168174978">(Jun 14 2019 at 21:59)</a>:</h4>
<blockquote>
<p>Also that we should really start converting this code to datafrog :P</p>
</blockquote>
<p>I didn't realize this was the official plan :)</p>



<a name="168174981"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168174981" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168174981">(Jun 14 2019 at 21:59)</a>:</h4>
<p>I guess it'd prob be best to sched for the week after next, owing to Moz all hands</p>



<a name="168174989"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168174989" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168174989">(Jun 14 2019 at 21:59)</a>:</h4>
<blockquote>
<p>I didn't realize this was the official plan :)</p>
</blockquote>
<p>"official"... well, it's <em>my</em> plan</p>



<a name="168175043"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168175043" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168175043">(Jun 14 2019 at 22:00)</a>:</h4>
<p>(in all seriousness, having dependent analyses is pretty easy in that case)</p>



<a name="168175044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168175044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168175044">(Jun 14 2019 at 22:00)</a>:</h4>
<blockquote>
<p>I guess it'd prob be best to sched for the week after next, owing to Moz all hands</p>
</blockquote>
<p>same schedule then</p>



<a name="168175105"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168175105" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168175105">(Jun 14 2019 at 22:01)</a>:</h4>
<p>that said, a possibly shorter term plan might be to do a "cursor" sort of API -- I think <code>state_for_location</code> kind of repeats <em>all</em> the work each time</p>



<a name="168175108"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168175108" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168175108">(Jun 14 2019 at 22:01)</a>:</h4>
<p>but presumably you are walking through the MIR in a certain order</p>



<a name="168175117"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168175117" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168175117">(Jun 14 2019 at 22:01)</a>:</h4>
<p>the idea would be to have an API that lets you reposition the cursor arbitrarily</p>



<a name="168175124"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168175124" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168175124">(Jun 14 2019 at 22:01)</a>:</h4>
<p>but to optimize for sequentially accessing statements within the same block</p>



<a name="168175134"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168175134" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168175134">(Jun 14 2019 at 22:02)</a>:</h4>
<p>ah, yeah, that sounds good</p>



<a name="168175177"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168175177" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168175177">(Jun 14 2019 at 22:02)</a>:</h4>
<p>but I'm not sure <em>quite</em> how difficult that would be; it's something <span class="user-mention" data-user-id="119009">@eddyb</span> suggested some time back and I thought it was clever</p>



<a name="168175193"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168175193" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168175193">(Jun 14 2019 at 22:02)</a>:</h4>
<p>I don't _think_ it would be difficult</p>



<a name="168175194"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168175194" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168175194">(Jun 14 2019 at 22:02)</a>:</h4>
<p>I'm trying to page this back in -- I feel like <span class="user-mention" data-user-id="116083">@pnkfelix</span> did think about the idea of dependent analyses a bit so let me go scout a bit to see if I see anything promising :)</p>



<a name="168175201"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168175201" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168175201">(Jun 14 2019 at 22:02)</a>:</h4>
<blockquote>
<p>I don't _think_ it would be difficult</p>
</blockquote>
<p>doesn't seem <em>that</em> hard indeed</p>



<a name="168175223"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168175223" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168175223">(Jun 14 2019 at 22:03)</a>:</h4>
<p>I could probably hack it together as part of my PR</p>



<a name="168175235"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168175235" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168175235">(Jun 14 2019 at 22:03)</a>:</h4>
<p>implement it* I mean :)</p>



<a name="168175237"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168175237" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168175237">(Jun 14 2019 at 22:03)</a>:</h4>
<p>I'm basically trying to remember if there already exists any such cases</p>



<a name="168175329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168175329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168175329">(Jun 14 2019 at 22:05)</a>:</h4>
<p>it could probably be done just by hacking on <code>FlowAtLocation</code>, <span class="user-mention" data-user-id="116883">@tmandry</span></p>



<a name="168175343"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168175343" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168175343">(Jun 14 2019 at 22:05)</a>:</h4>
<p>(like it's not that far from what's there already)</p>



<a name="168175450"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168175450" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168175450">(Jun 14 2019 at 22:07)</a>:</h4>
<p>ah yes, that seems promising</p>



<a name="168175552"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168175552" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168175552">(Jun 14 2019 at 22:08)</a>:</h4>
<p>I don't see anything doing quite what you're doing</p>



<a name="168175565"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168175565" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168175565">(Jun 14 2019 at 22:08)</a>:</h4>
<p>so I think that's my best suggestion</p>



<a name="168175575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168175575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168175575">(Jun 14 2019 at 22:09)</a>:</h4>
<p>besides porting everything to datafrog</p>



<a name="168175620"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168175620" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168175620">(Jun 14 2019 at 22:09)</a>:</h4>
<p>ok. I think a light wrapper around <code>FlowAtLocation</code> that remembers its last location sounds best, probably</p>



<a name="168175674"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168175674" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168175674">(Jun 14 2019 at 22:10)</a>:</h4>
<p>rather than having two ways of using the same object</p>



<a name="168175699"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168175699" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168175699">(Jun 14 2019 at 22:10)</a>:</h4>
<p>thanks for the pointer <span class="user-mention" data-user-id="116009">@nikomatsakis</span></p>



<a name="168175937"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168175937" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168175937">(Jun 14 2019 at 22:15)</a>:</h4>
<p>conceptually this makes sense... <code>DataflowResultsConsumer</code> is the main "driver" for <code>FlowAtLocation</code> today, whereas if you're being driven by something else, you need a <code>DataflowResultsCursor</code> instead</p>



<a name="168176569"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168176569" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168176569">(Jun 14 2019 at 22:26)</a>:</h4>
<p>(actually, maybe <code>FlowAtLocation</code> should just do this)</p>



<a name="168204043"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168204043" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168204043">(Jun 15 2019 at 11:19)</a>:</h4>
<p><span class="user-mention" data-user-id="116883">@tmandry</span> the cleanest way to write dependent dataflow passes I have found so far is to interleave them</p>



<a name="168204095"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168204095" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168204095">(Jun 15 2019 at 11:21)</a>:</h4>
<p>However the traditional dataflow implementations don’t usually allow for that easily.</p>



<a name="168204098"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168204098" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168204098">(Jun 15 2019 at 11:21)</a>:</h4>
<p>if you’re interested in that despite the caveats, feel free to ping me and we can chat in more detail.</p>



<a name="168253381"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168253381" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168253381">(Jun 16 2019 at 13:47)</a>:</h4>
<blockquote>
<p>the idea would be to have an API that lets you reposition the cursor arbitrarily, but to optimize for sequentially accessing statements within the same block</p>
</blockquote>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> <span class="user-mention" data-user-id="116883">@tmandry</span> I've not just suggested it but also implemented it, for a different dataflow system (a bidirectional one :P)</p>



<a name="168253382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168253382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168253382">(Jun 16 2019 at 13:47)</a>:</h4>
<p>or I should say, "symmetrical"</p>



<a name="168253442"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168253442" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168253442">(Jun 16 2019 at 13:49)</a>:</h4>
<p>ah dammit I keep finding and linking to <a href="https://github.com/rust-lang/rust/issues/46321" target="_blank" title="https://github.com/rust-lang/rust/issues/46321">#46321</a> when I mean <a href="https://github.com/rust-lang/rust/issues/47954" target="_blank" title="https://github.com/rust-lang/rust/issues/47954">#47954</a></p>



<a name="168253640"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168253640" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168253640">(Jun 16 2019 at 13:55)</a>:</h4>
<p>anyway this is what I had <a href="https://github.com/rust-lang/rust/pull/47954/commits/ed395ca5dfffff13d4f52f8b2c831e0d8fa294a3#diff-dfa62bf4fa7aefc62a25f618c203f921R302" target="_blank" title="https://github.com/rust-lang/rust/pull/47954/commits/ed395ca5dfffff13d4f52f8b2c831e0d8fa294a3#diff-dfa62bf4fa7aefc62a25f618c203f921R302">https://github.com/rust-lang/rust/pull/47954/commits/ed395ca5dfffff13d4f52f8b2c831e0d8fa294a3#diff-dfa62bf4fa7aefc62a25f618c203f921R302</a></p>



<a name="168253645"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168253645" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168253645">(Jun 16 2019 at 13:55)</a>:</h4>
<p>I called it an "observer"</p>



<a name="168254234"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168254234" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168254234">(Jun 16 2019 at 14:10)</a>:</h4>
<p>which I guess fit more with "eventflow" than regular dataflow</p>



<a name="168256033"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168256033" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168256033">(Jun 16 2019 at 15:05)</a>:</h4>
<p>Doesn’t that require maintaining extra data? I can imagine situations where it isn’t always possible to undo changes to factset which occurred as part of a transfer function over a statement.</p>



<a name="168256441"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168256441" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168256441">(Jun 16 2019 at 15:19)</a>:</h4>
<p><span class="user-mention" data-user-id="123586">@nagisa</span> while I maintained extra data, it <em>could</em> reset from the start of the block if not moved forward</p>



<a name="168256498"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168256498" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168256498">(Jun 16 2019 at 15:20)</a>:</h4>
<p>I see… so it is still O(n^2) with some caching to mitigate that</p>



<a name="168256501"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168256501" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168256501">(Jun 16 2019 at 15:20)</a>:</h4>
<p>normal usage would not be quadratic, it's more like a fallback</p>



<a name="168346928"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168346928" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168346928">(Jun 17 2019 at 20:59)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span> yeah I ended up writing something similar, just not bidirectional</p>



<a name="168353193"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168353193" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168353193">(Jun 17 2019 at 22:27)</a>:</h4>
<p><span class="user-mention" data-user-id="123586">@nagisa</span> by interleave, do you mean computing them simultaneously?</p>



<a name="168356252"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168356252" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168356252">(Jun 17 2019 at 23:17)</a>:</h4>
<p><span class="user-mention" data-user-id="116883">@tmandry</span> yes. This is done by composing the transfer functions of the different analyses you’re interested in and running them all for a single statement before proceeding to the next one.</p>



<a name="168356337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168356337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168356337">(Jun 17 2019 at 23:18)</a>:</h4>
<p>This way any transfer function can gain access (if you want them to) to any intermediate factset that gets generated by any other analysis as well and this way you also get optimal results for any given combination of dataflow analyses.</p>



<a name="168356386"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168356386" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168356386">(Jun 17 2019 at 23:19)</a>:</h4>
<p><span class="user-mention" data-user-id="123586">@nagisa</span> makes sense, but as you say it's not very convenient in the current framework (if you need to get the individual passes back out)</p>



<a name="168356457"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168356457" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168356457">(Jun 17 2019 at 23:20)</a>:</h4>
<p>yeah, it makes the dataflow loop a tight knot between all the involved analyses..</p>



<a name="168356487"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168356487" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168356487">(Jun 17 2019 at 23:21)</a>:</h4>
<p>Actually, it still might not work in my case. I need to know the <em>final</em> state of a different pass at each point to compute my pass (not just the gen/kill set for individual statements)</p>



<a name="168356498"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168356498" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168356498">(Jun 17 2019 at 23:21)</a>:</h4>
<p>or at least, I think I do :)</p>



<a name="168356561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168356561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168356561">(Jun 17 2019 at 23:22)</a>:</h4>
<p>That is fine, the dataflow analysis keeps running until a fixed point is reached, so you will re-visit a certain statement if there is new information known about it after it gets visited a first/2nd/3rd time etc.</p>



<a name="168356567"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168356567" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168356567">(Jun 17 2019 at 23:22)</a>:</h4>
<p>the only thing you won’t know is whether any particular visitation is the last one.</p>



<a name="168356603"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168356603" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168356603">(Jun 17 2019 at 23:23)</a>:</h4>
<p>ah okay, that should work then</p>



<a name="168356643"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168356643" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168356643">(Jun 17 2019 at 23:24)</a>:</h4>
<p>I will try to find a paper which describes this technique</p>



<a name="168356652"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168356652" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168356652">(Jun 17 2019 at 23:24)</a>:</h4>
<p><a href="http://research.microsoft.com/en-us/um/people/simonpj/Papers/c--/hoopl-haskell10.pdf" target="_blank" title="http://research.microsoft.com/en-us/um/people/simonpj/Papers/c--/hoopl-haskell10.pdf">http://research.microsoft.com/en-us/um/people/simonpj/Papers/c--/hoopl-haskell10.pdf</a> describes it.</p>



<a name="168356694"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168356694" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168356694">(Jun 17 2019 at 23:25)</a>:</h4>
<p>It also has motivating examples for this specific approach over the traditional dataflow analysis implementations.</p>



<a name="168638120"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168638120" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168638120">(Jun 20 2019 at 21:56)</a>:</h4>
<blockquote>
<p>I'm trying to page this back in -- I feel like <span class="user-mention silent" data-user-id="116083">pnkfelix</span> did think about the idea of dependent analyses a bit so let me go scout a bit to see if I see anything promising :)</p>
</blockquote>
<p>finally getting back to this</p>



<a name="168638130"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168638130" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168638130">(Jun 20 2019 at 21:56)</a>:</h4>
<p>the main example of a dependent analysis that I had worked on</p>



<a name="168638137"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168638137" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168638137">(Jun 20 2019 at 21:56)</a>:</h4>
<p>was the hacked up version of two-phase borrows</p>



<a name="168638143"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168638143" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168638143">(Jun 20 2019 at 21:56)</a>:</h4>
<p>that I did in PR <a href="https://github.com/rust-lang/rust/issues/46537" target="_blank" title="https://github.com/rust-lang/rust/issues/46537">#46537</a></p>



<a name="168638154"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168638154" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168638154">(Jun 20 2019 at 21:57)</a>:</h4>
<p>it has since been thrown away</p>



<a name="168638200"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168638200" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168638200">(Jun 20 2019 at 21:57)</a>:</h4>
<p>but you can see at least my comments documenting what I did <a href="https://github.com/rust-lang/rust/pull/46537/files#diff-74dcd7740ab2104cd2b9a3b68dd4f208R72" target="_blank" title="https://github.com/rust-lang/rust/pull/46537/files#diff-74dcd7740ab2104cd2b9a3b68dd4f208R72">here</a></p>



<a name="168638303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168638303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168638303">(Jun 20 2019 at 21:59)</a>:</h4>
<p>however I would certainly not say that I was <em>happy</em> with this design</p>



<a name="168638319"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168638319" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168638319">(Jun 20 2019 at 21:59)</a>:</h4>
<p>and I will probably take a look at the hoopl paper that <span class="user-mention" data-user-id="123586">@nagisa</span> linked above</p>



<a name="168638534"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/dependent%20dataflow%20analyses/near/168638534" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/dependent.20dataflow.20analyses.html#168638534">(Jun 20 2019 at 22:02)</a>:</h4>
<blockquote>
<p>however I would certainly not say that I was <em>happy</em> with this design</p>
</blockquote>
<p>in fact, reviewing the PR now, I am reminded of all the terrible kludges that were in it. For example, If i recall correctly, I had a bunch of ugly stuff, like making the bitvector twice as big as you'd expect, so that it would store the intermediate values for <em>both</em> of the two analyses in a single bitvector.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>